import java.io.Serializable;

public class Product implements Serializable {
    private Integer id;
    private String name;
    private String description;
    private Double price;
    private Integer stock;

    public Product() {}

    public Product(Integer id, String name, String description, Double price, Integer stock) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.price = price;
        this.stock = stock;
    }

    // Getters and Setters
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }

    public Double getPrice() { return price; }
    public void setPrice(Double price) { this.price = price; }

    public Integer getStock() { return stock; }
    public void setStock(Integer stock) { this.stock = stock; }

    @Override
    public String toString() {
        return String.format("商品ID: %d, 名称: %s, 描述: %s, 价格: %.2f, 库存: %d",
                id, name, description, price, stock);
    }
}